package com.cong.modules.meeting.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.cong.common.util.StringUtils;
import com.cong.modules.meeting.model.MeetingRecords;
import com.cong.modules.meeting.mapper.MeetingRecordsMapper;
import com.cong.modules.meeting.service.IMeetingRecordsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 会议纪要 服务实现类
 * </p>
 *
 * @author baomidou
 * @since 2025-05-02
 */
@Service
public class MeetingRecordsServiceImpl extends ServiceImpl<MeetingRecordsMapper, MeetingRecords> implements IMeetingRecordsService {

    @Resource
    private MeetingRecordsMapper meetingRecordsMapper;

    @Override
    public List<MeetingRecords> listMeetingRecords(MeetingRecords meetingRecords) {
        LambdaQueryWrapper<MeetingRecords> queryWrapper = new LambdaQueryWrapper<>();
        if (StringUtils.isNotEmpty(meetingRecords.getTitle())) {
            queryWrapper.like(MeetingRecords::getTitle, meetingRecords.getTitle());
        }
        if (meetingRecords.getStatus() != null) {
            queryWrapper.eq(MeetingRecords::getStatus, meetingRecords.getStatus());
        }
        return meetingRecordsMapper.selectList(queryWrapper);
    }

}
